{function name='category_checkboxes' structure=[] selected=[] level=1 chbname='task[categories][]' idprefix=''}{if $structure}<ul class="category_checkboxes_ul ul_level_{$level}">{foreach $structure as $node}<li><div><input type="checkbox" name="{$chbname}" value="{$node.category->id}"{if in_array($node.category->id, $selected)} checked="checked"{/if} id="{$idprefix}tasks_categories_{$node.category->id}_id" /><label for="{$idprefix}tasks_categories_{$node.category->id}_id">{translate_text|escape:'html' text=$node.category->name}</label></div>{category_checkboxes structure=$node.subcategories selected=$selected level=$level+1 chbname=$chbname idprefix=$idprefix}</li>{/foreach}</ul>{/if}{/function}